Unlock the AHardwareBuffer from direct CPU access.
Must be called after all changes to the buffer are completed by the
caller. If \a fence is NUL, the function will block until all work
is completed. Otherwise, \a fence will be set either to a valid file
descriptor or to -1. The file descriptor will become signaled once
the unlocking is complete and buffer contents are updated.
The caller is responsible for closing the file descriptor once it's
no longer needed. The value -1 indicates that unlocking has already
completed before the function returned and no further operations are
necessary.
\return 0 on success. -EINVAL if \a buffer is NUL. Error number if
the unlock fails for any reason.
Unlock the AHardwareBuffer from direct CPU access.
Must be called after all changes to the buffer are completed by the caller. If \a fence is NUL, the function will block until all work is completed. Otherwise, \a fence will be set either to a valid file descriptor or to -1. The file descriptor will become signaled once the unlocking is complete and buffer contents are updated. The caller is responsible for closing the file descriptor once it's no longer needed. The value -1 indicates that unlocking has already completed before the function returned and no further operations are necessary.
\return 0 on success. -EINVAL if \a buffer is NUL. Error number if the unlock fails for any reason.